package org.feiye.studyday27.thread;

public class Test extends Thread {
	private String sThreadName;

	public static void main(String argv[]) {
		Test h = new Test();
		h.go();
	}

	public Test(String sThreadName) {
		this.sThreadName = sThreadName;
	}

	public Test() {
	}

	public String getsThreadName() {
		return sThreadName;
	}

	public void setsThreadName(String sThreadName) {
		this.sThreadName = sThreadName;
	}

	public void go() {
		Test first = new Test("first");
		first.start();
		Test second = new Test("second");
		second.start();
	}

	public void start() {
		for (int i = 0; i < 2; i++) {
			System.out.println(getsThreadName() + i);
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				System.out.println(e.getMessage());
			}
		}
	}
}
